package com.rightin.reader.hf.rfidenum;

import java.util.HashMap;

public enum EnumRfidCommand {
    GetSystemInfo(0),
    Inventory(1),
    StayQuiet(2),
    ReadSingleBlocks(32),
    WriteSingleBlocks(33),
    LockBlocks(34),
    ReadMultipleBlocks(35),
    WriteMultipleBlocks(36),
    Select(37),
    ResetToReady(38),
    WriteAFI(39),
    LockAFI(40),
    WriteDSFID(41),
    LockDSFID(42),
    GetTagSystem(43),
    GetMulBlocksSecurity(44),
    SetEAS(162),
    ResetEAS(163),
    LockEAS(164),
    AlarmEAS(165),
    PwdProtect(166),
    InventoryMultipleBlocks(80),
    WritePwd(180),
    LockPwd(181),
    SWOn(193),
    SWOff(194),
    Noise(229),
    ReaderCmd(250);

    private int intValue;

    private static HashMap<Integer, EnumRfidCommand> mappings;

    private static synchronized HashMap<Integer, EnumRfidCommand> getMappings() {
        if (mappings == null)
            mappings = new HashMap<>();
        return mappings;
    }

    EnumRfidCommand(int value) {
        this.intValue = value;
        getMappings().put(Integer.valueOf(value), this);
    }

    public int getValue() {
        return this.intValue;
    }

    public static EnumRfidCommand forValue(int value) {
        return getMappings().get(Integer.valueOf(value));
    }
}

